
#ifndef _PROP_STACK_H
#define _PROP_STACK_H

#include <sys/queue.h>

#include <prop/prop_object.h>

struct _prop_stack_intern_elem {
	prop_object_t object;
	void *object_data[3];
};

struct _prop_stack_extern_elem {
	SLIST_ENTRY(_prop_stack_extern_elem) stack_link;
	prop_object_t object;
	void *object_data[3];
};

#define	PROP_STACK_INTERN_ELEMS	16

struct _prop_stack {
	struct _prop_stack_intern_elem intern_elems[PROP_STACK_INTERN_ELEMS];
	size_t used_intern_elems;
	SLIST_HEAD(, _prop_stack_extern_elem) extern_elems;
};

typedef struct _prop_stack *prop_stack_t;

void	_prop_stack_init(prop_stack_t);
bool	_prop_stack_push(prop_stack_t, prop_object_t, void *, void *, void *);
bool	_prop_stack_pop(prop_stack_t, prop_object_t *, void **, void **, void **);

#endif
